]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
Don't check for Workspaces.WindowClone for window drops
authorOwen W. Taylor <otaylor@fishsoup.net>
Mon, 31 Jan 2011 01:25:00 +0000 (20:25 -0500)
committerOwen W. Taylor <otaylor@fishsoup.net>
Wed, 9 Feb 2011 00:43:20 +0000 (19:43 -0500)
When checking the type of a DND source, instead of checking
'instanceof Workspaces.WindowClone' accept any actor with realWindow
and metaWindow properties. This will be useful to support a separate
type of actor dragged from workspace thumbnails.

https://bugzilla.gnome.org/show_bug.cgi?id=640996

js/ui/appDisplay.js
js/ui/dash.js
js/ui/workspace.js
js/ui/workspacesView.js

index 4628a5a7a1b73feb96baa27baa4e605d492c98df..caec10f3728499ecbdb889da89d9660e236edd6d 100644 (file)
@@ -632,7 +632,7 @@ AppIconMenu.prototype = {
     },
 
     _findMetaWindowForActor: function (actor) {
-        if (actor._delegate instanceof Workspace.WindowClone)
+        if (actor._delegate.metaWindow)
             return actor._delegate.metaWindow;
         else if (actor.get_meta_window)
             return actor.get_meta_window();
index 7e6ce1d538be3267ac42483eff5631a69cedfba1..0ddae0b2c25e0a4a3985b498f7fa13c7603b4546 100644 (file)
@@ -54,7 +54,7 @@ RemoveFavoriteIcon.prototype = {
         if (source instanceof AppDisplay.AppWellIcon) {
             let appSystem = Shell.AppSystem.get_default();
             app = appSystem.get_app(source.getId());
-        } else if (source instanceof Workspace.WindowClone) {
+        } else if (source.metaWindow) {
             let tracker = Shell.WindowTracker.get_default();
             app = tracker.get_window_app(source.metaWindow);
         }
@@ -148,7 +148,7 @@ Dash.prototype = {
         let app = null;
         if (dragEvent.source instanceof AppDisplay.AppWellIcon)
             app = this._appSystem.get_app(dragEvent.source.getId());
-        else if (dragEvent.source instanceof Workspace.WindowClone)
+        else if (dragEvent.source.metaWindow)
             app = this._tracker.get_window_app(dragEvent.source.metaWindow);
         else
             return DND.DragMotionResult.CONTINUE;
@@ -265,7 +265,7 @@ Dash.prototype = {
         let app = null;
         if (source instanceof AppDisplay.AppWellIcon)
             app = this._appSystem.get_app(source.getId());
-        else if (source instanceof Workspace.WindowClone)
+        else if (source.metaWindow)
             app = this._tracker.get_window_app(source.metaWindow);
 
         // Don't allow favoriting of transient apps
@@ -316,7 +316,7 @@ Dash.prototype = {
         let app = null;
         if (source instanceof AppDisplay.AppWellIcon) {
             app = this._appSystem.get_app(source.getId());
-        } else if (source instanceof Workspace.WindowClone) {
+        } else if (source.metaWindow) {
             app = this._tracker.get_window_app(source.metaWindow);
         }
 
index 09faf91deb3fd38e45aa12dcb768ea32ad12b531..0241213c119f3359e1c97a3090bd770dd5811594 100644 (file)
@@ -1412,7 +1412,7 @@ Workspace.prototype = {
     },
 
     acceptDrop : function(source, actor, x, y, time) {
-        if (source instanceof WindowClone) {
+        if (source.realWindow) {
             let win = source.realWindow;
             if (this._isMyWindow(win))
                 return false;
index 1fe5409051c54686cad71c4c9f822e2ebcfeb981..ac6096f63b6d7d6fa82b4f02bab242fa8cc67973 100644 (file)
@@ -264,7 +264,7 @@ WorkspacesView.prototype = {
     },
 
     _handleDragOverNewWorkspace: function(source, dropActor, x, y, time) {
-        if (source instanceof Workspace.WindowClone)
+        if (source.realWindow)
             return DND.DragMotionResult.MOVE_DROP;
         if (source.shellWorkspaceLaunch)
             return DND.DragMotionResult.COPY_DROP;